Uninitialized size before xcalloc fixed
authoroliskoli <oliskoli>
Sat, 22 Oct 2005 21:32:37 +0000 (21:32 +0000)
committeroliskoli <oliskoli>
Sat, 22 Oct 2005 21:32:37 +0000 (21:32 +0000)
coto.c

diff --git a/coto.c b/coto.c
index d3d363b082ca512a756c5b16922f31d4bcaf9b58..1869aa2edcaef331fd5d121e07ebfe0691087091 100644 (file)
--- a/coto.c
+++ b/coto.c
@@ -361,6 +361,8 @@ coto_wpt_write(const waypoint *wpt)
        {
                notes = xstrdup(wpt->notes);
        }
+
+       size = sizeof(*rec);
        if (notes != NULL)
                size += strlen(notes);
        rec = xcalloc(size, 1);